{itemplate 'public/header'}
<div class="page page-activity-list">
	<header class="bar bar-nav common-bar-nav">
		<a href="javascript:;" class="pull-left back"><i class="icon icon-arrow-left"></i></a>
		<h1 class="title">店铺活动</h1>
	</header>
	<div class="buttons-tab activity_status">
		<a href="{php echo ifilter_url('status:2');}" class="button {if $status == 2} active {/if}">待生效</a>
		<a href="{php echo ifilter_url('status:1');}" class="button {if $status == 1} active {/if}">进行中</a>
		<a href="{php echo ifilter_url('status:0');}" class="button {if $status == 0} active {/if}">已结束</a>
	</div>
	{itemplate 'public/nav'}
	<div class="content">
		{loop $activity $item}
	 		<div class="card">
				<div class="card-header border-1px-b">
					<div class="activity-title">
						{$item['title']}
					</div>
					<span class="pull-right">
						{if $status == 1}
							进行中 剩余<i>{$item['until']}天</i>
						{elseif $status == 2}
							未开始
						{elseif $status == 0}
							已结束
						{/if}
					</span>
				</div>
	    		<div class="card-content">
	      			<div class="card-content-inner">
	      				{if $item['type'] == couponCollect || $item['type'] == couponGrant}
		      				<div class="row border-1px-b">
								<div class="col-33">
									<div class="col-title">券总张数</div>
									<div class="col-item">
										<i>
											{if $item['type'] == couponCollect}
												{php echo $item['coupon_detail']['total'] * $item['coupon_detail']['amount']}
											{else}
												{$item['coupon_detail']['amount']}
											{/if}
										</i>张
									</div>
								</div>
								<div class="col-33">
									<div class="col-title">发放数量</div>
									<div class="col-item text-red">
										<i>
											{if $item['type'] == couponCollect}
												{$item['coupon_detail']['dosage_total']}
											{else}
												{$item['coupon_detail']['dosage']}
											{/if}
										</i>张
									</div>
								</div>
								<div class="col-33">
									<div class="col-title">使用数量</div>
									<div class="col-item text-red">
										<i>{$item['coupon_detail']['is_use_total']}</i>张
									</div>
								</div>
			  				</div>
		  				{/if}
	      				<div class="discription">
							<div class="one-list clearfix">
								<div class="left">活动类型:</div>
								<div class="right">
									{if $item['type'] == bargain}
										天天特价
									{elseif $item['type'] == discount}
										店铺满减
									{elseif $item['type'] == grant}
										满赠活动
									{elseif $item['type'] == newMember}
										线路新用户
									{elseif $item['type'] == selfDelivery}
										自提优惠
									{elseif $item['type'] == couponCollect}
										进店领券
									{elseif $item['type'] == couponGrant}
										满返优惠
									{/if}
								</div>
							</div>
							{if $item['type'] == couponCollect}
								<div class="one-list clearfix">
									<div class="left">券的金额:</div>
									<div class="right">
										{loop $item['data'] $coupon}
											{$coupon['discount']}元|满{$coupon['condition']}可用 
										{/loop}
									</div>
								</div>
								<div class="one-list clearfix">
									<div class="left">券有效期:</div>
									<div class="right">
										{loop $item['data'] $times}
											领券后{$times['use_days_limit']}天内 
										{/loop}
									</div>
								</div>
							{elseif $item['type'] == couponGrant}
								<div class="one-list clearfix">
									<div class="left">返券条件:</div>
									<div class="right">订单满{$item['coupon_detail']['condition']}元</div>
								</div>
								<div class="one-list clearfix">
									<div class="left">券的金额:</div>
									<div class="right">
										{$item['data']['discount']}元|满{$item['data']['condition']}可用
									</div>
								</div>
								<div class="one-list clearfix">
									<div class="left">券有效期:</div>
									<div class="right">
										领券后{$item['data']['use_days_limit']}天内
									</div>
								</div>
							{elseif $item['type'] == newMember}
								<div class="one-list clearfix">
									<div class="left">活动规则:</div>
									<div class="right">
										线路新客立减{$item['data']['back']}元
									</div>
								</div>
							{elseif $item['type'] == grant}
								<div class="one-list clearfix">
									<div class="left">活动规则:</div>
									<div class="right">
										{loop $item['data'] $row}
											满{$row['condition']}赠送{$row['back']} 
										{/loop}
									</div>
								</div>
							{elseif $item['type'] == discount}
								<div class="one-list clearfix">
									<div class="left">活动规则:</div>
									<div class="right">
										{loop $item['data'] $row}
											满{$row['condition']}减{$row['back']}元
										{/loop}
									</div>
								</div>
							{/if}
							<div class="one-list clearfix">
								<div class="left">开始时间:</div>
								<div class="right">{php echo date('Y-m-d', $item['starttime'])}</div>
							</div>
							<div class="one-list clearfix">
								<div class="left">结束时间:</div>
								<div class="right">{php echo date('Y-m-d', $item['endtime'])}</div>
							</div>
							<div class="one-list clearfix">
								<div class="left">创建日期:</div>
								<div class="right">{php echo date('Y-m-d', $item['addtime'])}</div>
							</div>
						</div>
					</div>
				</div>
				<div class="card-footer">
					<a href="{php echo imurl('manage/activity/list/del', array('type' => $item['type']));}" class="js-post" data-confirm="确定撤销活动么">
						撤销活动
					</a>
	    		</div>
	 		</div>
 		{/loop}
 		{if empty($activity)}
			<div class="no-data">
				<div class="bg"></div>
				<p>没有任何活动哦~</p>
			</div>
 		{/if}
	</div>
</div>
{itemplate 'public/footer'}